<?php
$adminid = $this->session->userdata('adminid');
?>

<div id="wrapper-content">

    <table class="titrepage" width="100%">
        <tr>
            <td >La liste des gardiens</td>
            <td align="right">Total | <?php echo $total ?> </td>
        </tr>
    </table>
    <div align="left" id="ajouter" >
        <table width="100%">
            <tr>
                <td align="left"><a href="<?php echo site_url('seatting_admin/add_gardient') ?>">Ajouter nouveau gardient</a></td>
            <td align="right">
                  <?php echo form_open('seatting_admin/search_gardient'); ?>
                Recherche par nom : <input type="text" name="search_name" size="25" value=""/>
                <input type="submit" name="search" value=" Recherche " />
            </td>
            </tr>
        </table>
      
    <?php echo form_close(); ?>
    </div>
    <?php if(isset($name_search)&&$name_search!='_'):?>
        <h3>Résultats pour <?php echo '"'.$name_search.'"';?></h3>
    <?php endif;?>
    <?php if($total>0){ ?>
    <table width="100%" class="list">
        <thead>
            <tr>
                <th>Nom</th>
                <th>Date de naissance</th>
                <th colspan="3">Action</th>
            </tr>
        </thead>
<?php foreach ($query as $aRow): ?>
        <?php
            $pattern = "%d/%m/%Y";
            $dob = mdate($pattern, $aRow['dob']);
        ?>
                    <tr>
                        <td><?php echo $aRow['gardient_name']; ?></td>
                        <td><?php echo $dob; ?></td>
                        <?php if($aRow['available']== 1){?>
                        <td width="70px"><a style="color: blue;"  href="<?php echo site_url('seatting_admin/set_unavailable_gardient') . '/' . $aRow['id']?>" >Disponible</a></td>
                        <?php }else{ ?>
                            <td width="70px"><a style="color: red;" href="<?php echo site_url('seatting_admin/set_available_gardient') . '/' . $aRow['id']?>" >Indisponible</a></td>
                        <?php }?>
                        <td width="70px">
                            <a  href="<?php echo site_url('seatting_admin/detail_gardient') . '/' . $aRow['id'] ; ?>"><img border="0"src="<?php echo root_url('seatting-falin') . 'assets/admin/' ?>images/detail.png"/></a>
                        </td>
                        <td width="70px">
                        <a class="supprimer" href="#" ><img border="0"src="<?php echo root_url('seatting-falin') . 'assets/admin/' ?>images/supprimer.png"/></a>
                        <div style="display:none">
                    		    	Confirmer <br/>
                                        <a href="<?php echo site_url('seatting_admin/delete_gardient') . '/' . $aRow['id'] . '/' . $per_page . '/' . $off_set; ?>"> <img border="0"src="<?php echo root_url('seatting-falin') . 'assets/admin/' ?>images/oui.png"/></a>
                    <a class="non" href="#" ><img  border="0"src="<?php echo root_url('seatting-falin') .  'assets/admin/' ?>images/non.png"/></a>
                </div>

            </td>
        </tr>
<?php endforeach; ?>
                </table>
<?php echo $pagination; ?>
<?php } else{ ?>
 <h1>Not found!!!</h1>
 <?php } ?>
</div>
<!--END wrapper-content-->
